Public Member Functions
ProjectItem Class Reference

Detailed Description

The ProjectItem class represents the base content class in Softimage from which all other content objects derive. Its major feature is that it provides access to the parameters which represent the state of the object.

Many classes in Softimage support this interface, such as X3DObject, Property, Shader, Operator, and Primitive. The classes that do not support this are lightweight classes like Particle, Point, Geometry and Parameter, utility classes such as CValue, CColor, CGraphicSequencer or classes that are not content-related such as Command, Application and UIToolkit.

#include <xsi_projectitem.h>

Inheritance diagram for ProjectItem:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  ProjectItem ()
  ~ProjectItem ()
  ProjectItem (const CRef &in_ref)
  ProjectItem (const ProjectItem &in_obj)
bool  IsA (siClassID in_ClassID) const
siClassID  GetClassID () const
ProjectItem operator= (const ProjectItem &in_obj)
ProjectItem operator= (const CRef &in_ref)
CString  GetFamilies () const
siCapabilities  GetCapabilities () const
CStatus  PutCapabilityFlag (siCapabilities in_flag, bool in_bEnable)
bool  GetSelected (siBranchFlag in_branchFlag=siNode) const
CStatus  PutSelected (bool in_newState, siBranchFlag in_branchFlag=siNode)
CRefArray  GetOwners () const
CParameterRefArray GetParameters () const
Model  GetModel () const
bool  IsRelationship (siPSetRelationship in_PSetRelationship) const
bool  BelongsTo (const CString &in_family) const
bool  IsKindOf (const CString &in_objectType) const
bool  IsAnimated (siSourceType in_sourceType=siAnySource, bool in_bLocal=false) const
CRefArray  GetAnimatedParameters (siSourceType in_sourceType=siAnySource, bool in_bLocal=false) const
CRef  EvaluateAt (double in_dFrame=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, bool in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, double in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, float in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, short in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, LONG in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, LLONG in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, const CValue &in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, const CRef &in_val, double in_time=DBL_MAX)
CStatus  PutParameterValue (const CString &in_scriptname, const CString &in_val, double in_time=DBL_MAX)
CValue  GetParameterValue (const CString &in_scriptname, double in_time=DBL_MAX) const
Parameter  GetParameter (const CString &in_scriptname) const
PPGLayout  GetPPGLayout () const
siLockType  GetLockType ()
siLockLevel  GetLockLevel ()
bool  IsLocked ()
CStatus  SetLock (siLockLevel in_level=siLockLevelAll)
CStatus  UnSetLock (siLockLevel in_level=siLockLevelAll, const CString &in_password=CString())
CRefArray  GetTaggedParameters (siTags in_tags=siTagAll, bool in_bLocal=false) const
CRefArray  GetLockOwners (siLockLevel in_eLevel=siLockLevelAll, bool in_bLocal=false) const
CRef  AddScriptedOp (const CString &in_code=L"", const CRefArray &in_inputs=CRefArray(), const CString &in_name=L"", const CString &in_language=L"", siConstructionMode in_mode=siConstructionModeDefault, CStatus *out_pst=0)
CRef  AddScriptedOpFromFile (const CString &in_filename=L"", const CRefArray &in_inputs=CRefArray(), const CString &in_name=L"", const CString &in_language=L"", siConstructionMode in_mode=siConstructionModeDefault, CStatus *out_pst=0)
CRef  AddCustomOp (const CString &in_type, const CRefArray &in_inputs=CRefArray(), const CString &in_name=L"", siConstructionMode in_mode=siConstructionModeDefault, CStatus *io_pst=0)
CRefArray  GetLockOwners () const
X3DObject  GetParent3DObject () const
siBranchFlag  GetBranchFlag () const
CRefArray  GetICEAttributes () const
ICEAttribute  GetICEAttributeFromName (const CString &in_name) const
ICEAttribute  AddICEAttribute (const CString &in_name, XSI::siICENodeDataType in_DataType, XSI::siICENodeStructureType in_StructureType, XSI::siICENodeContextType in_ContextType)
CStatus  RemoveICEAttribute (const CString &in_name)
ULONG  GetObjectID () const
LONG  GetEvaluationID ()
LONG  GetHierarchicalEvaluationID ()

Constructor & Destructor Documentation

Default constructor.

Default destructor.

ProjectItem ( const CRef in_ref )

Constructor.

Parameters:
in_ref constant reference object.
ProjectItem ( const ProjectItem in_obj )

Copy constructor.

Parameters:
in_obj constant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID ) const [virtual]
siClassID GetClassID ( ) const [virtual]
ProjectItem& operator= ( const ProjectItem in_obj )

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_obj constant class object.
Returns:
The new ProjectItem object.
ProjectItem& operator= ( const CRef in_ref )
CString GetFamilies ( ) const

Returns the names of all the families the object belongs to.

Returns:
String representing all families to which this object belongs.
siCapabilities GetCapabilities ( ) const

Returns a mask of all the object's capabilities.

Returns:
The object's capabilities.
CStatus PutCapabilityFlag ( siCapabilities  in_flag,
bool  in_bEnable 
)

Disables or enables any Capability flag set on the object. For example an object can be hidden from the Scene Explorer by setting the siNotInspectable flag. Changing the capability flags only affects one particular instance of the object.

Parameters:
in_flag Specify the flag to change
in_bEnable True to set the capability; false to remove it.
See also:
Parameter::GetCapabilities
Since:
5.1
bool GetSelected ( siBranchFlag  in_branchFlag = siNode ) const

Returns the object's selected state.

Parameters:
in_branchFlag Is the object selected in node or branch? the default value is siNode. This argument only applies to objects that have children such as the X3DObject and Model objects.
Returns:
true if the current object is selected.
CStatus PutSelected ( bool  in_newState,
siBranchFlag  in_branchFlag = siNode 
)

Sets the object's selected state.

Parameters:
in_newState new state
in_branchFlag Is the object to be selected in node or branch? the default value is siNode. This argument only applies to objects that have children such as the X3DObject and Model objects.
Returns:
CStatus::OK success
CStatus::Fail other failure
CRefArray GetOwners ( ) const

Returns an array of references to all owners of this object. If this function is called from the cb_Operator_Update Update context of a custom operator it returns an empty CRefArray.

Returns:
Array of references to owners.
CParameterRefArray& GetParameters ( ) const

Returns an array of references to all parameters within the object that support read access; that is, you can get their value using Parameter::GetValue.

Note:
This function builds a cache of all parameters. Building the cache can be costly performance wise. Use this function in cases where the object has many parameters and you need to access most of them. It is more suitable to use GetParameter if you only need to access a few parameters.
Returns:
Array of Parameter objects
See also:
ProjectItem::GetParameter, Parameter::GetParameter
Returns:
Array of references to parameters.
Model GetModel ( ) const

Returns the Model to which the object belongs. If this method is called from the cb_Operator_Update Update context of a custom operator it returns an invalid Model.

Returns:
The Model to which this object belongs.
bool IsRelationship ( siPSetRelationship  in_PSetRelationship ) const

Returns true if the object has the required kind of parent/child parameter-set (Pset) relationship with its parent and false otherwise

Note:
Prior to v5.0 this was called IsA(). This conflicted with the other IsA() method for testing the class id. This function maps to ProjectItem.IsA in the scripting object model.
Parameters:
in_PSetRelationship Type of Pset relationship to check.
Returns:
true if the object has the specified type of Pset relationship with its parent; otherwise false.
Since:
5.0
bool BelongsTo ( const CString in_family ) const

Returns true if the object belongs to specified family and false otherwise.

Parameters:
in_family Family (or families) to check
Returns:
true if the object belongs to the specified family; otherwise false.
See also:
siFamily
bool IsKindOf ( const CString in_objectType ) const

Returns true if this object matches a given type and false otherwise.

Parameters:
in_objectType an object type.
Returns:
true if this object matches a given type; otherwise false.
bool IsAnimated ( siSourceType  in_sourceType = siAnySource,
bool  in_bLocal = false 
) const

Returns true if the object is animated by a specific animation source type and false otherwise.

Parameters:
in_sourceType Animation source type. The default value is any source.
in_bLocal Specifies whether the animation to check is local to the object or not. If true then all animated parameters that come from propagated properties or from intermediate nodes are ignored. Intermediate nodes are nested under the object but are not necessary owned by the object itself. For instance, the camera object nested under a Texture_Projection_Def property is not considered unless the target object is the projection property itself. When the flag is set to false (default), all parameters are considered.
Returns:
true if the object is animated; false otherwise.
CRefArray GetAnimatedParameters ( siSourceType  in_sourceType = siAnySource,
bool  in_bLocal = false 
) const

Returns an array of references to parameters that are animated by a specific animation source type. If this method is called from the Update() context of a custom operator it will return an empty CRefArray.

Parameters:
in_sourceType an object type.
in_bLocal Specifies whether the animation to check is local to the object or not. If true then all animated parameters that come from propagated properties or from intermediate nodes are ignored. Intermediate nodes are nested under the object but are not necessary owned by the object itself. For instance, the camera object nested under a Texture_Projection_Def property is not considered unless the target object is the projection property itself. When the flag is set to false (default), all parameters are considered.
Returns:
Array of references to Parameter objects.
CRef EvaluateAt ( double  in_dFrame = DBL_MAX )

Returns a version of the object at a particular time.

Parameters:
in_dFrame Time in frames at which to evaluate object, the default value is DBL_MAX which means the current time.
Returns:
Reference to the object.
CStatus PutParameterValue ( const CString in_scriptname,
bool  in_val,
double  in_time = DBL_MAX 
)

Sets the value of a parameter nested under this ProjectItem. If you try to set a read-only parameter, an error (CStatus::Unexpected) occurs. You can check if a parameter is read-only by checking the condition:

Note that you can set a custom property parameter even if it is created with the read-only capability.

Note:
This function does not build a cache of all parameter values. Use this function in cases where the object has many parameters but you only need to set the value on a few of them.
Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
See also:
ProjectItem::GetParameterValue
CStatus PutParameterValue ( const CString in_scriptname,
double  in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
float  in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
short  in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
LONG  in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
LLONG  in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note:
LLONG types are not supported as a native parameter value type, so the input value will be converted to the parameter type specified by in_scriptname.
Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
const CValue in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
const CRef in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CStatus PutParameterValue ( const CString in_scriptname,
const CString in_val,
double  in_time = DBL_MAX 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
in_val The parameter value to set.
in_time Time in frame, defaults to the current frame(this is represented by the value of DBL_MAX).
Returns:
CStatus::OK success
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
CStatus::Fail Other failure
CValue GetParameterValue ( const CString in_scriptname,
double  in_time = DBL_MAX 
) const

Returns the value of a parameter nested under the ProjectItem. If the parameter doesn't exist an empty CValue is returned. If the parameter value is a string and it has not been set then an empty string is returned.

Note:
This function does not build a cache of all parameter values. Use this function in cases where the object has many parameters but you only need to get the value on a few of them.
Parameters:
in_scriptname The script name of the parameter for which we want to get the value (see Parameter::GetScriptName).
in_time Time in frame defaults to the current frame (represented by the value of DBL_MAX).
Returns:
The parameter value.
See also:
Parameter::GetValue, Parameter::GetScriptName
Parameter GetParameter ( const CString in_scriptname ) const

Returns a particular parameter of this object. If the parameter script name does not exist the Parameter will be invalid and all functions will return default values.

Note:
This function does not build a cache of all parameter values. Use this function in cases where the object has many parameters but you only need to get a few of them.
Parameters:
in_scriptname The script name of the parameter (see Parameter::GetScriptName).
Returns:
A Parameter object.
See also:
Parameter::GetParameters
PPGLayout GetPPGLayout ( ) const

Returns the layout associated with this project item. The Layout defines how the Parameters of the ProjectItem are presented visually when the object is inspected.

See also:
PPGLayout
Since:
4.0
siLockType GetLockType ( )

Returns the lock type if the parameter is locked.

Returns:
The type of owner (::siLockOwnerNone if not locked).
Since:
4.0
siLockLevel GetLockLevel ( )

Returns the lock level for this parameter.

Returns:
The level of lock (siLockLevelNone if not locked).
Since:
4.0
bool IsLocked ( )

Indicates whether or not a parameter is locked.

Returns:
true if the Parameter is locked.
Since:
4.0
CStatus SetLock ( siLockLevel  in_level = siLockLevelAll )

Locks a parameter.

Parameters:
in_level The level to lock. Can be siLockLevelAll for all levels
Returns:
CStatus
Since:
4.0
CStatus UnSetLock ( siLockLevel  in_level = siLockLevelAll,
const CString in_password = CString() 
)

Unlocks a parameter.

Parameters:
in_level The level to unlock. Can be siLockLevelAll for all levels
in_password The optional password to pass when the scene locks are password protected
Returns:
CStatus
Since:
4.0
CRefArray GetTaggedParameters ( siTags  in_tags = siTagAll,
bool  in_bLocal = false 
) const

Returns an array of references to parameters that are tagged by a specific tag

Parameters:
in_tags the tags to check
in_bLocal Specifies whether the tags to check is local to the parameters or not. If true then all tagged parameters that come from propagated properties or from intermediate nodes are ignored. Intermediate nodes are nested under the object but are not necessary owned by the object itself. For instance, the camera object nested under a Texture_Projection_Def property is not considered unless the target object is the projection property itself. When the flag is set to false (default), all parameters are considered.
Returns:
Array of references to Parameter objects.
Since:
4.0
CRefArray GetLockOwners ( siLockLevel  in_eLevel = siLockLevelAll,
bool  in_bLocal = false 
) const

Returns an array of references to parameters that are owner of a lock

Parameters:
in_eLevel the level to check
in_bLocal Specifies whether the lock to check is local to the object or not. If true then all lock owners that come from propagated properties or from intermediate nodes are ignored. Intermediate nodes are nested under the object but are not necessary owned by the object itself. For instance, the camera object nested under a Texture_Projection_Def property is not considered unless the target object is the projection property itself. When the flag is set to false (default), all parameters are considered.
Returns:
Array of references to Parameter objects.
Since:
4.0
CRef AddScriptedOp ( const CString in_code = L"",
const CRefArray in_inputs = CRefArray(),
const CString in_name = L"",
const CString in_language = L"",
siConstructionMode  in_mode = siConstructionModeDefault,
CStatus out_pst = 0 
)

Creates a new runtime scripted operator and connects its output to this object. If the scripting file is not specified then a default implementation will be used. For parameter connections a simple assignment of the current value be use created for example 'out.value = 0.00'.

Specifying the scripting language is optional. If not specified then the language associated with the file extension will be used. If this cannot be determined then the current scripting language user preference will used.

Tip:
This is the C++ API version of the AddScriptedOpFromFile command, which also creates a runtime scripted operator. To create a Self-Installed Custom Operator, use the ProjectItem::AddCustomOp instead.
Parameters:
in_code The script containing the implementation of the scripted operator.
in_inputs Array of objects or parameters to be connected to input ports.
in_name Name of the new scripted operator
in_language The script language of the new scripted operator. If not specified the value current user preference for the scripting language will be used.
in_mode Specifies the construction mode in which the operator will be applied. This only applies to output connections made to Geometry objects, the mode will be ignored for all other types of connections.
Return values:
out_pst Optional error status
Returns:
The new runtime scripted operator
Empty CRef on failure
Since:
4.0
CRef AddScriptedOpFromFile ( const CString in_filename = L"",
const CRefArray in_inputs = CRefArray(),
const CString in_name = L"",
const CString in_language = L"",
siConstructionMode  in_mode = siConstructionModeDefault,
CStatus out_pst = 0 
)

Creates a new scripted operator and connects its output to this object. If the scripting file is not specified then a default implementation will be used. For parameter connections a simple assignment of the current value be use created for example 'out.value = 0.00'.

Specifying the scripting language is optional. If not specified then the language associated with the file extension will be used. If this cannot be determined then the current scripting language user preference will used.

Tip:
This is the C++ API version of the AddScriptedOpFromFile command, which also creates a runtime scripted operator. To create a Self-Installed Custom Operator, use the ProjectItem::AddCustomOp instead.
Parameters:
in_filename The script filename containing the implementation of the scripted operator.
in_inputs Array of objects or parameters to be connected to input ports.
in_name Name of the new scripted operator
in_language The script language of the new scripted operator. If not specified the value current user preference for the scripting language will be used.
in_mode Specifies the construction mode in which the operator will be applied. This only applies to output connections made to Geometry objects, the mode will be ignored for all other types of connections.
Return values:
out_pst Optional error status
Returns:
A reference to the new scripted operator
Empty CRef on failure
Since:
4.0
CRef AddCustomOp ( const CString in_type,
const CRefArray in_inputs = CRefArray(),
const CString in_name = L"",
siConstructionMode  in_mode = siConstructionModeDefault,
CStatus io_pst = 0 
)

Creates a new Self-Installed Custom Operator and connects its output to this object.

Tip:
This is the C++ API version of the AddCustomOp command, which also creates a Self-Installed Custom Operator. To create a runtime scripted operator, use the ProjectItem::AddScriptedOp function.
Parameters:
in_type The type of a operator. A PluginItem must be installed by this name.
in_inputs Array of objects or parameters to be connected to input ports.
in_name Name of the new custom operator. If not specified the type is used to determine a name for the operator.
in_mode Specifies the construction mode in which the operator will be applied. This only applies to output connections made to Geometry objects, the mode will be ignored for all other types of connections.
Return values:
io_pst Optional error status
Returns:
A reference to the CustomOperator
Empty CRef on failure
See also:
cus_ops Custom Operators
Since:
5.1
CRefArray GetLockOwners ( ) const

Returns an array of references to objects that are master of the lock of this object.

Returns:
Array of references of the lock masters for this object. Empty if not locked.
Since:
4.0
X3DObject GetParent3DObject ( ) const

Returns the X3DObject to which the object belongs.

Note:
If this function is called from the cb_Operator_Update Update context of a custom operator it will return an invalid X3DObject.
Returns:
The X3DObject to which this object belongs.
Since:
5.0
siBranchFlag GetBranchFlag ( ) const

Returns the branch flag. The branch flag is used in the context of adding objects to the Selection or to a Group. You can check if an object was added to a group as a branch member or if an object has been branch selected by testing if the branchflag has been set to siBranch.

Note:
To change the group member to a branch member you must remove and re-add the member to the group. To change a select object to a branch selected object you must deselect then reselect the object.
Returns:
siBranchFlag
Since:
5.0
CRefArray GetICEAttributes ( ) const

Returns all attributes defined for this object.

Returns:
Array of references to ICEAttribute objects.
See also:
ProjectItem::GetICEAttributes
Since:
7.0
ICEAttribute GetICEAttributeFromName ( const CString in_name ) const

Returns the attribute data matching a specific name.

Parameters:
in_name Name of the attribute to find.
Returns:
The ICEAttribute object.
See also:
Geometry::GetICEAttributeFromName
Since:
7.0
Example:
This example shows how to access the PointPosition attribute by name.
        CValue CreatePrim( const CString& in_presetobj, const CString& in_geometrytype, const CString& in_name, const CString& in_parent );
        CValue Create2DSkeleton( const CValue& in_rx, const CValue& in_ry, const CValue& in_rz, const CValue& in_ex, const CValue& in_ey, const CValue& in_ez, const CValue& in_nx, const CValue& in_ny, const CValue& in_nz, const CValue& in_viewtype,  CValue& out_bone,  CValue& out_effector );
        CValue AppendBone( const CValue&  in_inputobjs, const CValue& in_ex, const CValue& in_ey, const CValue& in_ez, bool in_pin );
        CValue ApplyFlexEnv( const CValue&  in_connectionset, bool in_assignnewdeformers,  XSI::siConstructionMode & io_constructionmode );
        void SelectObj( const CValue&  in_selectionlist, const CString& in_hierarchylevel, bool in_checkobjectselectability ) ;

        template < class T >
        class CICEAttributeData2DLogger
        {
            public:
            static void Log( ICEAttribute& attr )
            {
                CICEAttributeDataArray2D< T > data2D;
                attr.GetDataArray2D( data2D );

                Application xsi;
                for( ULONG i=0; i<data2D.GetCount( ); i++ )
                {
                    CICEAttributeDataArray< T > data;
                    data2D.GetSubArray( i, data );
                    for( ULONG j=0; j<data.GetCount( ); j++ )
                    {
                        xsi.LogMessage( CString( data[ j ] ) );
                    }
                }
            }
        };

        Application xsi;

        X3DObject cone = CreatePrim( L"Cone", L"MeshSurface", L"", L"");
        Create2DSkeleton( 2.95, 3.34, -0.33, 4.73, 0.0, 0.0, -5.71, 0, 0, 4, CValue(""), CValue(""));
        AppendBone( L"eff", 3.70, -3.02, 0.30, L"");

        XSI::siConstructionMode mode = siConstructionModeModeling;
        ApplyFlexEnv( L"cone;bone,bone1,eff", true, mode );
        SelectObj( L"cone.polymsh.cls.EnvelopWeightCls.Envelope_Weights", L"", L"" );

        // Makse sure to generate the data first
        cone.GetActivePrimitive().GetGeometry(0);

        ProjectItem envProp = xsi.GetSelection()[0];

        ICEAttribute attr = envProp.GetICEAttributeFromName( L"EnvelopeWeightsPerDeformer" );

        xsi.LogMessage( L"*******************************************************************" );
        xsi.LogMessage( L"Name: " + attr.GetName() );
        xsi.LogMessage( L"DataType: " + CString(attr.GetDataType()) );
        xsi.LogMessage( L"StructType: " + CString(attr.GetStructureType()) );
        xsi.LogMessage( L"ContextType: " + CString(attr.GetContextType()) );
        xsi.LogMessage( L"IsConstant: " + CString(attr.IsConstant()) );
        xsi.LogMessage( L"Readonly: " + CString(attr.IsReadonly()) );
        xsi.LogMessage( L"Category: " + CString(attr.GetCategory()) );
        xsi.LogMessage( L"Element count: " + CString(attr.GetElementCount()) );

        CICEAttributeData2DLogger<float>::Log( attr );

        // Helpers
        CValue CreatePrim( const CString& in_presetobj, const CString& in_geometrytype, const CString& in_name, const CString& in_parent )
        {
            CValueArray args(4);
            CValue retval;
            args[0]= in_presetobj;
            args[1]= in_geometrytype;
            args[2]= in_name;
            args[3]= in_parent;

            Application app;
            app.ExecuteCommand( L"CreatePrim", args, retval );
            return retval;
        }

        CValue Create2DSkeleton( const CValue& in_rx, const CValue& in_ry, const CValue& in_rz, const CValue& in_ex, const CValue& in_ey, const CValue& in_ez, const CValue& in_nx, const CValue& in_ny, const CValue& in_nz, const CValue& in_viewtype,  CValue& out_bone,  CValue& out_effector )
        {
            CValueArray args(12);
            CValue retval;

            args[0]= in_rx;
            args[1]= in_ry;
            args[2]= in_rz;
            args[3]= in_ex;
            args[4]= in_ey;
            args[5]= in_ez;
            args[6]= in_nx;
            args[7]= in_ny;
            args[8]= in_nz;
            args[9]= in_viewtype;

            Application app;
            app.ExecuteCommand( L"Create2DSkeleton", args, retval );

            out_bone = args[10];
            out_effector = args[11];
            return retval;
        }

        CValue AppendBone( const CValue&  in_inputobjs, const CValue& in_ex, const CValue& in_ey, const CValue& in_ez, bool in_pin )
        {
            CValueArray args(5);
            CValue retval;

            args[0]= in_inputobjs;
            args[1]= in_ex;
            args[2]= in_ey;
            args[3]= in_ez;
            args[4]= in_pin;

            Application app;
            app.ExecuteCommand( L"AppendBone", args, retval );

            return retval;
        }

        CValue ApplyFlexEnv( const CValue&  in_connectionset, bool in_assignnewdeformers,  XSI::siConstructionMode & io_constructionmode )
        {
            CValueArray args(3);
            CValue retval;

            args[0]= in_connectionset;
            args[1]= in_assignnewdeformers;
            args[2]= io_constructionmode;

            Application app;
            app.ExecuteCommand( L"ApplyFlexEnv", args, retval );

            io_constructionmode = (XSI::siConstructionMode)(LONG)args[2];
            return retval;
        }

        void SelectObj( const CValue&  in_selectionlist, const CString& in_hierarchylevel, bool in_checkobjectselectability )
        {
            CValueArray args(3);
            CValue retval;
            args[0]= in_selectionlist;
            args[1]= in_hierarchylevel;
            args[2]= in_checkobjectselectability;

            Application app;

            CStatus st = app.ExecuteCommand( L"SelectObj", args, retval );
            return;
        }
ICEAttribute AddICEAttribute ( const CString in_name,
XSI::siICENodeDataType  in_DataType,
XSI::siICENodeStructureType  in_StructureType,
XSI::siICENodeContextType  in_ContextType 
)

Adds and returns a new <object idref="ICEAttribute"> on this object. If the attribute already exists, the current attribute is returned.

Parameters:
in_name Name of the attribute to create.
in_DataType The attribute data type.
in_StructureType The attribute structure type.
in_ContextType The attribute context type.
Returns:
The newly created ICEAttribute object or the existing attribute if already defined.
See also:
Geometry::AddICEAttribute
Geometry::RemoveICEAttribute
Since:
11.0 (2013)
CStatus RemoveICEAttribute ( const CString in_name )

Removes the attribute identified with in_name from this object. The attribute is removed only if it is not a built-in attribute or not required by an ICETree.

Parameters:
in_name Name of the attribute to remove.
Returns:
CStatus::OK success
CStatus::False the attribute doesn't exist
CStatus::Fail failure
See also:
Geometry::AddICEAttribute
Geometry::RemoveICEAttribute
Since:
11.0 (2013)
ULONG GetObjectID ( ) const

Returns the object identifier.

Returns:
The object identifier or UINT_MAX if the object has no ID.
See also:
Application::GetObjectFromID, Shader::GetProgID
Since:
7.0
LONG GetEvaluationID ( )

Returns the last evaluation ID. The evaluation ID is a counter that is incremented each time the ProjectItem is evaluated (dirtied) by XSI. You can use this to detect whether a ProjectItem became dirty since the last time GetEvaluationID was called.

Return values:
The evaluation ID (LONG)
Returns:
-1 on failure
Since:
9.0 (2011)
LONG GetHierarchicalEvaluationID ( )

Returns the sum of the evaluation ID for the hierarchy of object that are nested under this object. This is equivalent to doing the sum manually of all EvaluationID for the object.

Return values:
The evaluation ID (LONG)
Returns:
-1 on failure
Since:
9.0 (2011)

The documentation for this class was generated from the following file: